import { Typography } from 'antd';
import { InbizIcon, getEditor } from '@inbiz/utils';
import { TextWidget } from '@inbiz/react';

const DetailHeader = (props: any) => {
  const isEditor = getEditor();

  const { Title } = Typography;

  //返回
  const goBack = () => {
    history.back();
  };

  return (
    props.title.status && (
      <div className="detail-header">
        <div className="tite-header" style={{ position: isEditor ? 'absolute' : 'fixed' }}>
          <span onClick={goBack}>
            <InbizIcon type="icon-ic-arrow-left-bold" />
          </span>
          <Title ellipsis={{ tooltip: true }} className="inbiz-BizHeader-title">
            <span>
              <TextWidget>{props.title.value}</TextWidget>
            </span>
          </Title>
        </div>
      </div>
    )
  );
};
export default DetailHeader;
